// 引入 Vue-Router
import VueRouter from 'vue-router'

// 引入 home 组件
import homeComponent from './components/Tabbar/homeComponent.vue'

// 引入 home news 组件
import newsListComponent from './components/newsComponents/newsListComponent.vue'
import newsInfoComponent from './components/newsComponents/newsInfoComponent.vue'

// 引入 home photo 组件
import photoListComponent from './components/photoComponents/photoListComponent.vue'
import photoInfoComponent from './components/photoComponents/photoInfoComponent.vue'

// 引入 home goods 组件
import goodsListComponent from './components/goodsComponents/goodsListComponent.vue'
import goodsInfoComponent from './components/goodsComponents/goodsInfoComponent.vue'
import goodsDescComponent from './components/goodsComponents/goodsPhotoDescComponent.vue'
import goodsCommentComponent from './components/goodsComponents/goodsCommentComponent.vue'


// 引入 member 组件
import memberComponent from './components/Tabbar/memberComponent.vue'


// 引入 shopCar 组件
import shopCarComponent from './components/Tabbar/shopCarComponent.vue'


// 引入 search 组件
import searchComponent from './components/Tabbar/searchComponent.vue'

// 创建路由对象
const router = new VueRouter({
    routes: [
        // 初始化 跳转 home  路由
        { path: '/', redirect: '/home' },
        // 首页 路由
        { path: '/home', component: homeComponent },

        // 首页 news 路由
        { path: '/home/newsList', component: newsListComponent },
        { path: '/home/newsInfo/:id', component: newsInfoComponent },

        // 首页 photo 路由
        { path: '/home/photoList', component: photoListComponent },
        { path: '/home/photoInfo/:id', component: photoInfoComponent },

        // 首页 goods 路由
        { path: '/home/goodsList', component: goodsListComponent },
        { path: '/home/goodsInfo/:id', component: goodsInfoComponent },
        { path: '/home/goodsDesc/:id', component: goodsDescComponent, name:'goodsDesc' },
        { path: '/home/goodsComment/:id', component: goodsCommentComponent, name:'goodsComment' },


        // 会员 路由
        { path: '/member', component: memberComponent },


        // 购物车 路由
        { path: '/shopCar', component: shopCarComponent },


        // 搜索 路由
        { path: '/search', component: searchComponent }
    ],
    // 设置 点击后的 路由高亮
    linkActiveClass: 'mui-active'
})

// 把路由对象暴露出去
export default router